﻿using System.Threading.Tasks;

namespace SimulationCenter.Tasks.Svrs
{
    /// <summary>
    /// 公众号服务
    /// </summary>
    public interface ISubscriptionSvr
    {
        /// <summary>
        /// 将公众号与设备绑定
        /// </summary>
        /// <param name="device"></param>
        /// <param name="subscription"></param>
        /// <returns></returns>
        Task BindDeviceSubscription(string device, string subscription);

        /// <summary>
        /// 根据公众号获取消息检索范围
        /// </summary>
        /// <param name="subscription"></param>
        /// <returns></returns>
        Task<(ScMsgRange range, int? lastDays)> GetFetchMsgsRange(string subscription);

        /// <summary>
        /// 根据 微信号 或者 公众号名称查找 ScSubscription 记录
        /// </summary>
        /// <param name="idOrSubscriptin"></param>
        /// <returns></returns>
        ScSubscription FindSubscription(string idOrSubscriptin);

        /// <summary>
        /// 绑定 微信号 与 公众号名称
        /// </summary>
        /// <param name="id"></param>
        /// <param name="subscription"></param>
        void BindSubscription(string id, string subscription);
    }
}
